<!-- reportingResults -->
<template>
    <div class="page">
        <!-- 导航栏 -->
        <div class="navBar">
            <!-- <customNavBar :leftTetx=leftTetx :titleTest=titleTest></customNavBar> -->
         <div style="text-align: left; padding-left: 13px; margin-top: 30px;" @click="goreportingJst()">
          <img class='contentg' src="../../assets/img/features/closeIcon.png" alt="">
         </div>
        <div class='cetjecsty'>
         <span >报告生成结果</span> 
        </div>
        </div>
        <!-- 页面内容 -->
        <div class="content">
            <div style="margin-top: 31px;">
                <van-image width=46vw height=38vw :src="viewReport" />
            </div>
            <div class='progressc'>
                <!-- 报告生成过程中遇到问题，系统正在积极解决! -->
                <!-- 您可稍晚通过点击<span>【一键重新检视】</span>进行重试。 -->
            </div>
            <div class='progressc'>报告生成过程中遇到问题，系统正在积极解决，请向邀请您使用本服务的机构或服务人员反馈此问题。错误码 {{data.errCode || ' '}}</div>
            <!-- <div class='contbottom' @click="goletterAdvce()">一键重新检视</div> -->
        </div>
    </div>
    <div class='pageBj' v-if="showDialog">
        <div class="pageBjDiv">
        <div class='pageBjDivHeader'>温馨提示</div>
        <div class='pageBjDivsection'>您确认要退出本次服务吗?</div>
        <div class="pageBjDivBtoom">
            <div @click="onConfirm()">继续退出</div>
            <div @click="onCancel()">取消</div>
        </div>
        </div>
    </div>
</template>

<script lang="ts" setup name="reportingResultcsb">
import { useRouter, useRoute } from "vue-router"
import { Toast } from '/@/utils/Message';
import { onMounted } from "vue"
import { reactive, ref } from 'vue'
import customNavBar from "/src/components/NavBar/customNavBar.vue"
import viewReport from "../../assets/img/tast/jxs.png"
import {oneTouchCreatTask} from "../../api/auth/addCustome"

const router = useRouter()
const route = useRoute()
const leftTetx = ref("")
const titleTest = ref("生成失败")
const showDialog = ref<boolean>(false)
let data = reactive({
  ...route.query,
});

const goletterAdvce = () => {
  oneTouchCreatTask({taskCode: data.taskCode}).then((rest:any) => {
    router.push({ path: '/letterAdvce', query: { taskCode: rest.taskCode,isScsb:1 }})
  })
    
}
const onConfirm = () => {
  // window.location.replace('./reportingResultwxts')
  router.push({ path: 'reportingResultwxts' })
}
const onCancel = () => {
  // 取消操作
  showDialog.value = false;
}
const goreportingJst = ():void => {
  showDialog.value = true
}
const backHome = () => {
    // 获取 User Agent
    var userAgent = navigator.userAgent.toLowerCase();
    // 判断是否在微信中打开
    if (userAgent.indexOf('micromessenger') !== -1) {
        setTimeout(function () {
        //这个可以关闭安卓系统的手机
        document.addEventListener(
            "WeixinJSBridgeReady",
            function () {
            WeixinJSBridge.call("closeWindow");
            },
            false
        );
        //这个可以关闭ios系统的手机
        WeixinJSBridge.call("closeWindow");
        } ,500);
    } else {
        console.log('当前页面不在微信中打开');
        if (userAgent.indexOf("Firefox") != -1 || userAgent.indexOf("Chrome") != -1) {
        window.location.href = "about:blank";
        } else if (userAgent.indexOf('Android') > -1 || userAgent.indexOf('Linux') > -1) {
        window.opener = null; window.open('about:blank', '_self', '').close();
        } else {
        window.opener = null;
        window.open("about:blank", "_self");
        window.close();
        }
    }

}
</script>

<!-- less嵌套设置 -->
<style lang="less" scoped>
.pageBj {
  top: 0;
  width: 100%;
  height: 100%;
  display: flex;
  position: absolute;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.7);
  .pageBjDiv {
    width: 300px;
    // padding: 10px 20px;
    border-radius: 10px;
    background: #ffffff;
    .pageBjDivHeader {
      margin-top: 17px;
      font-size: 14px;
      font-weight: bold;
    }
    .pageBjDivsection {
      margin-top: 17px;
      font-size: 13px;
    }
    .pageBjDivBtoom {
      display: flex;
      width: 100%;
      margin-top: 17px;
      justify-content: center;
      border-top: 1px solid #f3f3f3;
      div {
        padding: 10px 0;
        width: 50%;
      }
      div:last-child{
        color: #ffffff;
        background: #2c56ce;
        border-bottom-right-radius: 7px;
      }
    }
  }
}
.contentg{
  width: 30px;
  height: 27px;
}
.page {
    background-color: #FFFFFF;
    height: 100vh;
    width: 100vw;
    overflow-x: hidden;
    .content {
        width: 100%;
        padding-top: 68px;
        overflow: hidden;
        .progressc {
            // width: 317px;
            width: 84%;
            margin: 0 auto;
            // margin-left: 34px;
            font-size: 14px;
            color: #222222;
            font-weight: 200;
            margin-top: 22px;
            text-align: left;
            letter-spacing: 1.7px;
            span {
                color: #007DFA;
                font-weight: bold;
            }
        }
        .contbottom {
            width: 327px;
            height: 58px;
            font-weight: 500;
            color: #FFFFFF;
            margin-top: 130px;
            margin-left: 23px;
            line-height: 53px;
            text-align: center;
            background: url(../../assets/img/tast/bottom.png);
            background-size: 100% 100%;
            background-repeat: no-repeat;
        }
    }
}
</style>

